﻿using System;

namespace WeighingSystem
{
    public class WeighingSystem
    {
        private WeighingUnit _weighingUnit;
        private Printer _printer;

        public WeighingSystem()
        {
            _weighingUnit = new WeighingUnit();
            _printer = new Printer();
        }

        public void SetUnit(uint unit)
        {
            Console.WriteLine("WeighingUnit::SetUnit(): Setting unit to {0}", unit);
            _weighingUnit.SetUnit(unit);
        }


        public void WeighGoods()
        {
            var curWeight = _weighingUnit.GetWeight();
            _printer.PrintLabel(Math.Round(curWeight, 3));  // Print a label with the weight on it
        }
    }
}
